package br.ita.supertrunfo.client.view;

import java.awt.Point;
import javax.swing.*;

public class CartaIU extends JPanel {

	private static final long serialVersionUID = 1L;
	private String codigo;
	private JLabel cartaLabel;
	private Icon cartaIcon;
	private Point coordenadas;	

	
	//Construtor
	public CartaIU(String id, Point coordenadas){
		this.setCodigo(id.toUpperCase());
		this.setCartaIcon(new ImageIcon("img/decks/default/" + this.getCodigo() + ".png"));
		this.setCoordenadas(coordenadas);
		this.setCartaLabel();
	}

	
	//Getters and Setters
	public JLabel getCartaLabel(){
		return this.cartaLabel;
	}
	public void setCartaLabel(){
		this.cartaLabel = new JLabel(cartaIcon);
		this.cartaLabel.setSize(132,174);
		this.cartaLabel.setLocation(this.coordenadas);
	}

	public Point getCoordenadas() {
		return coordenadas;
	}
	public void setCoordenadas(Point coordenadas) {
		this.coordenadas = coordenadas;
	}
	
	public String getCodigo() {
		return codigo;
	}
	public void setCodigo(String codigo) {
		this.codigo = codigo;
	}

	private void setCartaIcon(Icon cartaRevelada) {
		this.cartaIcon = cartaRevelada;
	}	
}
